home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Meeting Pearls 2
/
Meeting Pearls Vol. II (1995)(GTI - Schatztruhe)[!].iso
/
Pearls
/
text
/
SoundBox
/
bonus
/
dt_scan.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-12-21
|
3KB
|
117 lines
/* DT-ARexx-Script
Scannen mehrerer Module und Erstellen einer Liste
$VER: dt_scan.rexx 0.4 (17.11.94) ©1994 ninji :-)
*/
options results
pt_player = "ProTracker NoiseTracker SoundTracker15 StarTrekker4"
call addlib("rexxreqtools.library", 0, -30, 0)
logfile = rtfilerequest(,
'RAM:','modul.list',,
'Bitte Zieldatei wählen ..',,"rtfi_matchpat='~(#?.info|.#?)'",okay)
if (okay ~= 1) then exit
if exists(logfile) then
open(log, logfile, append)
else open(log, logfile, write)
writeln(log, 'Scan-Ergebnis (' || date() || ',' time() || ')' || '0a'x)
close(log)
address DELITRACKER
saveconfig 'T:DT.config'
randmod no ;randsong no ;mod_num = 0
options failat 20
playlist 1
error = rc
options results
do until (mod_num == 1)
if (error ~= 0) then call write_fail
else call write_okay
nextsong
error = rc
status m num ;mod_num = result
end
loadconfig 'T:DT.config'
address command 'delete T:DT.config'
exit
write_fail:
call open(log, logfile, append)
call writeln(log, ' »»»» Oooops ... was''n das ?' || '0a'x)
call close(log)
error = 0
return
write_okay:
'status m dir' ;mod_dir = result
status m fil ;mod_fil = result
status m fmt ;mod_fmt = result
status m nam ;mod_nam = result
status m pnr ;pnr_num = result
'status p' pnr_num 'nam' ;pnr_nam = result
'status p' pnr_num 'ver' ;pnr_ver = result
'status p' pnr_num 'sub' ;pnr_sub = result
extens = ''
if (pos(mod_fmt,pt_player) ~= 0) then call get_samples
if (pnr_sub == 'yes') then
extens = ' (Subsongs möglich)' || extens || '0a'x
else extens = extens || '0a'x
address command 'list nohead "' || mod_dir || mod_fil || '" >T:dt_temp'
call open tempfile, 'T:dt_temp', read
fileinfo = readln(tempfile)
call close tempfile
call open log, logfile, append
call writeln log, fileinfo || '0a'x,
' Modul-Name: ' || '09'x || '"'mod_nam'"' || '0a'x,
' Format: ' || '09'x || mod_fmt || '0a'x ||,
extens
call close log
return
get_samples:
if (open(modul,mod_dir || mod_fil,read)) then do
string = readch(modul,20)
if (substr(string,1,4) == 'XPKF') then
extens = extens || ' XPK-gepacktes Modul (' || substr(string,9,4) || ')'
else do
i = 1
if (mod_fmt ~= 'SoundTracker15') then k = 32
else k = 16
do while(i < k)
string = readch(modul,30)
if (mod_fmt == 'NoiseTracker') then
name = translate(substr(string,1,22), ' ' || xrange('01'x,'ff'x), '00'x || xrange('01'x,'ff'x))
else name = translate(substr(string,1,21), ' ' || xrange('01'x,'ff'x), '00'x || xrange('01'x,'ff'x))
name = left(name,22)
if (mod_fmt == 'NoiseTracker') then
length = x2d(c2x(substr(string,23,2)))
else length = x2d(c2x(substr(string,23,2)))
length = length*2
if (strip(name) ~= '' | length ~= 0) then
extens = extens || ' #' || right(d2x(i),2) || ':',
name right(length,9) || '0A'x
i = i+1
end
end
call close(modul)
end
return